﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CRM.Entity;
using CRM.BLL;
using DP.Web.UI;
using DP.Common;

namespace CRM.Web.VehicleManage
{
    public partial class SaleAdd : Common.PageBase
    {

        T_DICTIONARY_BLL dBll = new T_DICTIONARY_BLL();
        T_SALEVEHICLE_BLL bll = new T_SALEVEHICLE_BLL();
        T_VEHICLE_BLL vBll = new T_VEHICLE_BLL();
        T_BUSINESSDIVISION_BLL bdBll = new T_BUSINESSDIVISION_BLL();
        T_CUSTOMER_BLL cBll = new T_CUSTOMER_BLL();
        private T_SUPPLIER_BLL supplierBll = new T_SUPPLIER_BLL();
        private T_MARKETDEPARTMENT_BLL marketDepartmentBll = new T_MARKETDEPARTMENT_BLL();
        private T_SERVICEPROVIDER_BLL serviceProviderBll = new T_SERVICEPROVIDER_BLL();
        private T_DEALER_BLL dealerBll = new T_DEALER_BLL();
        T_VEHICLECUSTOMER_BLL vehicleCustomerBll = new T_VEHICLECUSTOMER_BLL();

        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            PageHelper.SetPrePageUrl(this.Page);
            if (PageHelper.GetQueryString(this.Page, "OPENTYPE") == "NEWPAGE")
            {
                btnCancel.Value = "关闭";
                btnCancel.Attributes["onclick"] = "closeSelf();";
            }
            else
            {
                PageHelper.SetGoBackUrl(this.Page, btnCancel, StaticConstant.NotBackUrl);
            }
            PageHelper.SetPopCalender(this.Page, txtOFFLINEDATE);
            PageHelper.SetPopCalender(this.Page, txtMANUFACTUREDATE);
            PageHelper.SetPopCalender(this.Page, txtPURCHASEDATE);
            PageHelper.SetPopCalender(this.Page, txtCREATETIME);
            PageHelper.SetPopCalender(this.Page, txtLASTMODIFYTIME);
            PageHelper.SetPopCalender(this.Page, txtLASTSALEDATE);

        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                ddlBUSINESSDIVISIONIDBinding();
                ddlISHASGPSBinding();
                ddlPURCHASEMETHODBinding();
                ddlISSUBSIDIESBinding();
                ddlSALESTYPEBinding();
                ddlVEHICLESTATUSBinding();

                pageDataInit();
            }
        }


        #region 页面初始化数据绑定
        /// <summary>
        /// DDLs the ISHASGPS binding.
        /// </summary>
        private void ddlISHASGPSBinding()
        {
            EnumHelper.FillListControl(ddlISHASGPS, typeof(IsHasGPS));
        }

        /// <summary>
        /// 车辆状态
        /// DDLs the VEHICLESTATUS binding.
        /// </summary>
        private void ddlVEHICLESTATUSBinding()
        {

            ddlVEHICLESTATUS.DataSource = dBll.GetCacheListByType(this.Page, DictionaryType.GetNameByKey("VehicleStatus"));
            ddlVEHICLESTATUS.DataTextField = "DictValue";
            ddlVEHICLESTATUS.DataValueField = "DictKey";
            ddlVEHICLESTATUS.DataBind();
            ddlVEHICLESTATUS.Items.Insert(0, new ListItem("", ""));
        }

        /// <summary>
        /// 销售类型
        /// DDLs the SALESTYPE binding.
        /// </summary>
        private void ddlSALESTYPEBinding()
        {

            ddlSALESTYPE.DataSource = dBll.GetCacheListByType(this.Page, DictionaryType.GetNameByKey("SalesType"));
            ddlSALESTYPE.DataTextField = "DictValue";
            ddlSALESTYPE.DataValueField = "DictKey";
            ddlSALESTYPE.DataBind();
            ddlSALESTYPE.Items.Insert(0, new ListItem("", ""));

        }

        /// <summary>
        /// 是否政府补贴
        /// DDLs the ISSUBSIDIES binding.
        /// </summary>
        private void ddlISSUBSIDIESBinding()
        {

            ddlISSUBSIDIES.DataSource = dBll.GetCacheListByType(this.Page, DictionaryType.GetNameByKey("IsSubsidies"));
            ddlISSUBSIDIES.DataTextField = "DictValue";
            ddlISSUBSIDIES.DataValueField = "DictKey";
            ddlISSUBSIDIES.DataBind();
            ddlISSUBSIDIES.Items.Insert(0, new ListItem("", ""));

        }

        /// <summary>
        /// 购机方式
        /// DDLs the PURCHASEMETHOD binding.
        /// </summary>
        private void ddlPURCHASEMETHODBinding()
        {

            ddlPURCHASEMETHOD.DataSource = dBll.GetCacheListByType(this.Page, DictionaryType.GetNameByKey("PurchaseMethod"));
            ddlPURCHASEMETHOD.DataTextField = "DictValue";
            ddlPURCHASEMETHOD.DataValueField = "DictKey";
            ddlPURCHASEMETHOD.DataBind();
            ddlPURCHASEMETHOD.Items.Insert(0, new ListItem("", ""));

        }

        /// <summary>
        /// 供应商
        /// DDLs the SUPPLYCODE binding.
        /// </summary>
        private void ddlSUPPLYCODEBinding()
        {
            //string businessDivisionCode = string.Empty;
            //T_BUSINESSDIVISION_Entity bdEntity = bdBll.GetCache_T_BUSINESSDIVISION_EntityByKey(this.Page, StringHelper.ToInt(ddlBUSINESSDIVISIONID.SelectedValue.Trim()));
            //if (bdEntity != null)
            //{
            //    businessDivisionCode = bdEntity.BUSINESSDIVISIONCODE;
            //}

            //ddlSUPPLYCODE.DataSource = supplierBll.GetList(String.Format(" and BUSINESSDIVISIONCODE = '{0}' and Status = {1} ", businessDivisionCode, ((int)Status.启用).ToString()));
            //ddlSUPPLYCODE.DataTextField = "SupplierName";
            //ddlSUPPLYCODE.DataValueField = "SupplierCode";
            //ddlSUPPLYCODE.DataBind();
            //ddlSUPPLYCODE.Items.Insert(0, new ListItem("", ""));
        }

        /// <summary>
        /// 服务站
        /// DDLs the STATIONCODE binding.
        /// </summary>
        private void ddlSTATIONCODEBinding()
        {
            string businessDivisionCode = string.Empty;
            T_BUSINESSDIVISION_Entity bdEntity = bdBll.GetCache_T_BUSINESSDIVISION_EntityByKey(this.Page, StringHelper.ToInt(ddlBUSINESSDIVISIONID.SelectedValue.Trim()));
            if (bdEntity != null)
            {
                businessDivisionCode = bdEntity.BUSINESSDIVISIONCODE;
            }

            var list = serviceProviderBll.GetList(String.Format(" and BUSINESSDIVISIONCODE = '{0}' and Status = {1} and MarketDepartmentCode = '{2}' ", businessDivisionCode, ((int)Status.启用).ToString(), ddlMARKETDEPARTMENTCODE.SelectedValue.Trim()), " SERVICEPROVIDERNAME asc ")
                .Select(p => new
                {
                    ServiceProviderName = (p.SERVICEPROVIDERNAME.Length > 0) ? StringHelper.GetChineseSpell(p.SERVICEPROVIDERNAME[0].ToString()) + "-" + p.SERVICEPROVIDERNAME : p.SERVICEPROVIDERNAME,
                    ServiceProviderCode = p.SERVICEPROVIDERCODE,
                    ServiceProviderId = p.SERVICEPROVIDERID
                });
            ddlSTATIONCODE.DataSource = list;
            ddlSTATIONCODE.DataTextField = "ServiceProviderName";
            ddlSTATIONCODE.DataValueField = "ServiceProviderCode";
            ddlSTATIONCODE.DataBind();
            ddlSTATIONCODE.Items.Insert(0, new ListItem("", ""));
        }

        /// <summary>
        /// 经销商
        /// DDLs the DEALERCODE binding.
        /// </summary>
        private void ddlDEALERCODEBinding()
        {
            string businessDivisionCode = string.Empty;
            T_BUSINESSDIVISION_Entity bdEntity = bdBll.GetCache_T_BUSINESSDIVISION_EntityByKey(this.Page, StringHelper.ToInt(ddlBUSINESSDIVISIONID.SelectedValue.Trim()));
            if (bdEntity != null)
            {
                businessDivisionCode = bdEntity.BUSINESSDIVISIONCODE;
            }

            var list = dealerBll.GetList(String.Format(" and BUSINESSDIVISIONCODE = '{0}' and Status = {1}  and MarketDepartmentCode = '{2}' ", businessDivisionCode, ((int)Status.启用).ToString(), ddlMARKETDEPARTMENTCODE.SelectedValue.Trim()), " DEALERNAME asc ")
                .Select(p => new
                {
                    DealerName = (p.DEALERNAME.Length > 0) ? StringHelper.GetChineseSpell(p.DEALERNAME)[0].ToString() + "-" + p.DEALERNAME : p.DEALERNAME,
                    DealerCode = p.DEALERCODE,
                    DealerId = p.DEALERID

                });

            ddlDEALERCODE.DataSource = list;
            ddlDEALERCODE.DataTextField = "DealerName";
            ddlDEALERCODE.DataValueField = "DealerCode";
            ddlDEALERCODE.DataBind();
            ddlDEALERCODE.Items.Insert(0, new ListItem("", ""));
        }

        /// <summary>
        /// 市场部
        /// DDLs the MARKETDEPARTMENTCODE binding.
        /// </summary>
        private void ddlMARKETDEPARTMENTCODEBinding()
        {
            ddlMARKETDEPARTMENTCODE.Items.Clear();
            string businessDivisionCode = string.Empty;
            T_BUSINESSDIVISION_Entity bdEntity = bdBll.GetCache_T_BUSINESSDIVISION_EntityByKey(this.Page, StringHelper.ToInt(ddlBUSINESSDIVISIONID.SelectedValue.Trim()));
            if (bdEntity != null)
            {
                businessDivisionCode = bdEntity.BUSINESSDIVISIONCODE;
            }
            var list = marketDepartmentBll.GetList(String.Format(" and BUSINESSDIVISIONCODE = '{0}' and Status = {1} ", businessDivisionCode, ((int)Status.启用).ToString()), " MARKETDEPARTMENTNAME asc ")
                .Select(p => new
                {
                    MarketDepartmentName = (p.MARKETDEPARTMENTNAME.Length > 0) ? StringHelper.GetChineseSpell(p.MARKETDEPARTMENTNAME)[0].ToString() + "-" + p.MARKETDEPARTMENTNAME : p.MARKETDEPARTMENTNAME,
                    MarketDepartmentCode = p.MARKETDEPARTMENTCODE,
                    MarketDepartmentId = p.MARKETDEPARTMENTID
                });
            ddlMARKETDEPARTMENTCODE.DataSource = list;
            ddlMARKETDEPARTMENTCODE.DataTextField = "MarketDepartmentName";
            ddlMARKETDEPARTMENTCODE.DataValueField = "MarketDepartmentCode";
            ddlMARKETDEPARTMENTCODE.DataBind();
            ddlMARKETDEPARTMENTCODE.Items.Insert(0, new ListItem("", ""));
        }





        /// <summary>
        ///	事业部编号 下拉列表数据绑定
        /// </summary>
        private void ddlBUSINESSDIVISIONIDBinding()
        {
            ddlBUSINESSDIVISIONID.DataSource = bdBll.GetCacheList(this.Page, String.Format(" and Status = {0} ", ((int)Status.启用).ToString()), "Status");
            ddlBUSINESSDIVISIONID.DataTextField = "BUSINESSDIVISIONNAME";
            ddlBUSINESSDIVISIONID.DataValueField = "BUSINESSDIVISIONID";
            ddlBUSINESSDIVISIONID.DataBind();

            if (!UserLoginInfo.IsAdministrator())
            {
                ddlBUSINESSDIVISIONID.SelectedValue = _userLoginInfo.UserEntity.BUSINESSDIVISIONID.ToString();
                ddlBUSINESSDIVISIONID.Enabled = false;
            }

        }


        #endregion

        protected void ddlBUSINESSDIVISIONID_SelectedIndexChanged(object sender, EventArgs e)
        {
            ddlMARKETDEPARTMENTCODEBinding();
            ddlMARKETDEPARTMENTCODE_SelectedIndexChanged(null, null);
            ddlSUPPLYCODEBinding();
        }

        protected void ddlMARKETDEPARTMENTCODE_SelectedIndexChanged(object sender, EventArgs e)
        {
            ddlDEALERCODEBinding();
            ddlSTATIONCODEBinding();
        }

        private void pageDataInit()
        {
            string _vehicleid = String.IsNullOrEmpty(Request.QueryString["VEHICLEID"]) ? "" : Request.QueryString["VEHICLEID"].Trim();


            if (!String.IsNullOrEmpty(_vehicleid))
            {
                T_SALEVEHICLE_Entity entity = bll.GetEntity("VEHICLEID", _vehicleid);

                try
                {
                    ddlBUSINESSDIVISIONID.SelectedValue = entity.BUSINESSDIVISIONID.ToString();
                }
                catch (Exception ex)
                {

                }
                ddlBUSINESSDIVISIONID_SelectedIndexChanged(null, null);
                try
                {
                    ddlMARKETDEPARTMENTCODE.SelectedValue = entity.MARKETDEPARTMENTCODE;
                }
                catch (Exception ex)
                {

                }
                ddlMARKETDEPARTMENTCODE_SelectedIndexChanged(null, null);
                ddlDEALERCODEBinding();
                ddlSTATIONCODEBinding();
                ddlSUPPLYCODEBinding();
                try
                {
                    ddlDEALERCODE.SelectedValue = entity.DEALERCODE;
                }
                catch (Exception ex)
                {

                }
                try
                {
                    ddlSTATIONCODE.SelectedValue = entity.STATIONCODE;
                }
                catch (Exception ex)
                {

                }
                //ddlSUPPLYCODE.SelectedValue = entity.SUPPLYCODE;

                PageHelper.SetControlValue<T_SALEVEHICLE_Entity>(this.Page, entity);
                txtOFFLINEDATE.Text = (entity.OFFLINEDATE == null)
                                          ? ""
                                          : entity.OFFLINEDATE.Value.ToString("yyyy-MM-dd");
                txtMANUFACTUREDATE.Text = (entity.MANUFACTUREDATE == null)
                                              ? ""
                                              : entity.MANUFACTUREDATE.Value.ToString("yyyy-MM-dd");
                txtPURCHASEDATE.Text = (entity.PURCHASEDATE == null)
                                           ? ""
                                           : entity.PURCHASEDATE.Value.ToString("yyyy-MM-dd");
                txtCREATETIME.Text = (entity.CREATETIME == null) ? "" : entity.CREATETIME.Value.ToString("yyyy-MM-dd");
                txtLASTMODIFYTIME.Text = (entity.LASTMODIFYTIME == null)
                                             ? ""
                                             : entity.LASTMODIFYTIME.Value.ToString("yyyy-MM-dd");
                txtLASTSALEDATE.Text = (entity.LASTSALEDATE == null)
                                           ? ""
                                           : entity.LASTSALEDATE.Value.ToString("yyyy-MM-dd");


                lblTitle.Text = "售后车辆修改";
                if (UserLoginInfo.CheckMenuRight("VehicleManage/VehicleContactList.aspx"))
                {
                    frameContactList.Attributes["src"] = String.Format("VehicleContactList.aspx?VINCODE={0}",
                                                                       entity.VINCODE.Trim());
                }
                if (UserLoginInfo.CheckMenuRight("ClaimFormManage/List.aspx"))
                {
                    frameClaimForm.Attributes["src"] =
                        String.Format("../ClaimFormManage/List.aspx?SearchType=VehicleAssociate&VINCODE={0}",
                                      entity.VINCODE.Trim());
                }
                hfVINCODE.Value = entity.VINCODE;
                hfENGINENUMBER.Value = entity.ENGINENUMBER;
                btnAddWorkOrder.Visible = true;
                btnAssociateContact.Visible = true;
                btnAddContact.Visible = true;
            }
            else
            {
                string _vehicleResourcesID = PageHelper.GetQueryString(this.Page, "VehicleResourcesID");
                T_VEHICLE_Entity vEntity = vBll.GetEntity("VEHICLEID", _vehicleResourcesID);
                if (vEntity != null)
                {
                    try
                    {
                        ddlBUSINESSDIVISIONID.SelectedValue = vEntity.BUSINESSDIVISIONID.ToString();
                    }
                    catch (Exception ex)
                    {

                    }
                    ddlBUSINESSDIVISIONID_SelectedIndexChanged(null, null);
                    try
                    {
                        ddlMARKETDEPARTMENTCODE.SelectedValue = vEntity.MARKETDEPARTMENTCODE;
                    }
                    catch (Exception ex)
                    {

                    }
                    ddlMARKETDEPARTMENTCODE_SelectedIndexChanged(null, null);
                    ddlDEALERCODEBinding();
                    ddlSTATIONCODEBinding();
                    ddlSUPPLYCODEBinding();
                    try
                    {
                        ddlDEALERCODE.SelectedValue = vEntity.DEALERCODE;
                    }
                    catch (Exception ex)
                    {

                    }
                    try
                    {
                        ddlSTATIONCODE.SelectedValue = vEntity.STATIONCODE;
                    }
                    catch (Exception ex)
                    {

                    }

                    PageHelper.SetControlValue<T_VEHICLE_Entity>(this.Page, vEntity);
                    txtOFFLINEDATE.Text = (vEntity.OFFLINEDATE == null) ? "" : vEntity.OFFLINEDATE.Value.ToString("yyyy-MM-dd");
                    txtMANUFACTUREDATE.Text = (vEntity.MANUFACTUREDATE == null) ? "" : vEntity.MANUFACTUREDATE.Value.ToString("yyyy-MM-dd");
                    txtCREATETIME.Text = "";
                    txtLASTMODIFYTIME.Text = "";
                    if (bll.IsExist("VINCODE", vEntity.VINCODE) > 0)
                    {
                        lblVinCodeMessage.Text = "VINCODE以存在！";
                    }
                    else
                    {
                        lblVinCodeMessage.Text = "";
                    }
                }
                string _customerCode = PageHelper.GetQueryString(this.Page, "CustomerCode");
                T_CUSTOMER_Entity cEntity = cBll.GetEntity("CustomerCode", _customerCode);
                if (cEntity != null)
                {
                    txtCUSTOMERCODE.Text = cEntity.CUSTOMERCODE;
                    txtCUSTOMERNAME.Text = cEntity.CUSTOMERNAME;
                }
                string _tel = PageHelper.GetQueryString(this.Page, "Tel");
                if (!String.IsNullOrEmpty(_tel))
                {
                    txtCONTACTTEL.Text = _tel;
                }


                lblTitle.Text = "售后车辆添加";
                phTabs.Visible = false;
                btnAddContact.Visible = false;
                btnAssociateContact.Visible = false;

                if (vEntity == null)
                {
                    ddlMARKETDEPARTMENTCODEBinding();
                    ddlDEALERCODEBinding();
                    ddlSTATIONCODEBinding();
                    ddlSUPPLYCODEBinding();
                }

            }

            txtVINCODE.Enabled = false;
            txtCREATEPEOPLE.Enabled = false;
            txtCREATETIME.Enabled = false;
            txtLASTMODIFYPEOPLE.Enabled = false;
            txtLASTMODIFYTIME.Enabled = false;

            switch (UserLoginInfo.GetCurrentUserType())
            {
                case UserType.中心部门:
                    {

                    }
                    break;
                case UserType.市场部:
                    {

                    }
                    break;
                case UserType.供应商:
                    {

                    }
                    break;
                case UserType.服务商:
                    {
                        ddlSTATIONCODE.Enabled = false;
                    }
                    break;
                case UserType.经销商:
                    {
                        ddlDEALERCODE.Enabled = false;
                    }
                    break;


            }


        }

        protected void btnOK_Click(object sender, EventArgs e)
        {
            string _vehicleid = String.IsNullOrEmpty(Request.QueryString["VEHICLEID"]) ? "" : Request.QueryString["VEHICLEID"].Trim();


            T_SALEVEHICLE_Entity entity = bll.GetEntity("VEHICLEID", _vehicleid);

            if (entity != null)
            {
                PageHelper.GetControlValue<T_SALEVEHICLE_Entity>(this.Page, ref entity);
                entity.LASTMODIFYPEOPLE = _userLoginInfo.UserEntity.USERNAME;
                entity.LASTMODIFYPEOPLEID = _userLoginInfo.UserEntity.USERID;
                entity.LASTMODIFYTIME = DateTime.Now;
                T_BUSINESSDIVISION_Entity bdEntity = bdBll.GetCache_T_BUSINESSDIVISION_EntityByKey(this.Page, StringHelper.ToInt(ddlBUSINESSDIVISIONID.SelectedValue.Trim()));
                if (bdEntity != null)
                {
                    entity.BUSINESSDIVISIONCODE = bdEntity.BUSINESSDIVISIONCODE;
                    entity.BUSINESSDIVISIONNAME = bdEntity.BUSINESSDIVISIONNAME;
                }

                entity.DEALERNAME = ddlDEALERCODE.SelectedItem.Text;
                //entity.SUPPLYNAME = ddlSUPPLYCODE.SelectedItem.Text;
                entity.STATIONNAME = ddlSTATIONCODE.SelectedItem.Text;
                entity.MARKETDEPARTMENTNAME = ddlMARKETDEPARTMENTCODE.SelectedItem.Text;
                try
                {

                    long rel = bll.Update(entity);
                    if (rel > 0)
                    {
                        vehicleCustomerBll.SetVehicleCustomerInfo(entity, _userLoginInfo);
                        if (PageHelper.GetQueryString(this.Page, "OPENTYPE") == "NEWPAGE")
                        {

                        }
                        else
                        {
                            PageHelper.ShowMessage(this.Page, "修改成功！",
                                                   UserLoginInfo.FilterBackUrl(PageHelper.GetPrePageUrl(this),
                                                                               "salelist.aspx"));
                        }
                    }
                    else
                    {
                        PageHelper.ShowMessage(this.Page, "修改失败！");
                    }
                }
                catch (Exception ex)
                {

                    PageHelper.ShowMessage(this.Page, "修改失败！" + ex.Message);
                }
            }
            else
            {
                entity = new T_SALEVEHICLE_Entity();

                PageHelper.GetControlValue<T_SALEVEHICLE_Entity>(this.Page, ref entity);
                entity.CREATEPEOPLE = _userLoginInfo.UserEntity.USERNAME;
                entity.CREATEPEOPLEID = _userLoginInfo.UserEntity.USERID;
                entity.CREATETIME = DateTime.Now;
                entity.LASTMODIFYPEOPLE = _userLoginInfo.UserEntity.USERNAME;
                entity.LASTMODIFYPEOPLEID = _userLoginInfo.UserEntity.USERID;
                entity.LASTMODIFYTIME = DateTime.Now;
                T_BUSINESSDIVISION_Entity bdEntity = bdBll.GetCache_T_BUSINESSDIVISION_EntityByKey(this.Page, StringHelper.ToInt(ddlBUSINESSDIVISIONID.SelectedValue.Trim()));
                if (bdEntity != null)
                {
                    entity.BUSINESSDIVISIONCODE = bdEntity.BUSINESSDIVISIONCODE;
                    entity.BUSINESSDIVISIONNAME = bdEntity.BUSINESSDIVISIONNAME;
                }
                entity.DEALERNAME = ddlDEALERCODE.SelectedItem.Text;
                //entity.SUPPLYNAME = ddlSUPPLYCODE.SelectedItem.Text;
                entity.STATIONNAME = ddlSTATIONCODE.SelectedItem.Text;
                entity.MARKETDEPARTMENTNAME = ddlMARKETDEPARTMENTCODE.SelectedItem.Text;

                try
                {
                    long rel = bll.Insert(entity);
                    if (rel > 0)
                    {
                        vehicleCustomerBll.SetVehicleCustomerInfo(entity, _userLoginInfo);
                        if (PageHelper.GetQueryString(this.Page, "OPENTYPE") == "NEWPAGE")
                        {
                            PageHelper.RefreshOpener(true);
                        }
                        else
                        {
                            PageHelper.ShowMessage(this.Page, "添加成功！", "salelist.aspx");
                        }
                    }
                    else
                    {
                        PageHelper.ShowMessage(this.Page, "添加失改！");
                    }
                }
                catch (Exception ex)
                {

                    PageHelper.ShowMessage(this.Page, "添加失改！" + ex.Message);
                }

            }
        }


    }
}
